'use strict';
exports.main = async (event, context) => {
  //event为客户端上传的参数
  console.log('event : ', event)
  const {
    data
  } = await uniCloud.request({
    url: 'https://apis.map.qq.com/ws/direction/v1/driving/',
    data: {
      from: event.from,
      to: event.to,
      key: '4SJBZ-G2MRQ-UYY5T-4P6PM-TUYTK-FLB7A'
    }
  })
  //返回数据给客户端
  return data
};